package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum ClearGroupExit {
    KEEP("KEEP"), // 保留
    DELETE("DELETE"); // 删除

    private final String code;

    ClearGroupExit(String code){
        this.code = code;
    }

    public static ClearGroupExit byCode(String code) {
        for (ClearGroupExit e: ClearGroupExit.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean isKeep(String code){
        return KEEP.code.equalsIgnoreCase(code);
    }

    public static boolean isDelete(String code){
        return DELETE.code.equalsIgnoreCase(code);
    }
}
